package com.ciaojian.worker.controller;

import com.ciaojian.core.model.vo.HaloTitleVO;
import com.ciaojian.core.util.Result;
import com.ciaojian.worker.service.HaloTitleServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import lombok.Data;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * halo 券码控制器
 *
 * @author Atlakyn
 */
@Api(tags = "Halo 券码接口")
@Data
@RestController
@RequestMapping("/halo")
public class HaloController {
    @Resource
    private HaloTitleServiceImpl haloTitleService;

    @ApiOperation("查询全部 halo 支付标题")
    @ApiResponses(@ApiResponse(code = 200, message = "success", response = HaloTitleVO.class))
    @GetMapping("/titles")
    public Result find() {
        return Result.ok(haloTitleService.getBaseMapper().findAll());
    }
}